import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:local_task/pages/Intro.dart';
import 'package:local_task/pages/home.dart';
import 'package:shared_preferences/shared_preferences.dart';

import 'package:flutter/widgets.dart';
import '../controller/intro_controller.dart';



/// 简单的存储服务
late SharedPreferences sharedPreferences;

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  // 简单的存储服务
  sharedPreferences = await SharedPreferences.getInstance();

  // 检测是否使用过引导页。
  IntroController introController = Get.put(IntroController());
  bool flag = introController.firstRunIntro();

  // Get.changeTheme(ThemeData.dark());
  runApp(GetMaterialApp(
    debugShowCheckedModeBanner: false,
    defaultTransition: Transition.rightToLeftWithFade,
    home: flag ? Home() : Intro(),
  ));


}



